import React from "react";
import { View } from "@tarojs/components";
import classNames from "classnames";
import PropTypes from 'prop-types';
import styles from "./index.less";

const ActionSheetHeader = (props) => {

  const { 
    cancelText, 
    title, 
    confirmText,
    onCancel,
    onConfirm,
    cancelClassName,
    confirmClassName,
  } = props;

  return (
    <View className={styles.float__header}>
      <View className={classNames(styles.header__span, styles.login__cancel, cancelClassName)} onClick={onCancel}>{cancelText}</View>
      <View className={classNames(styles.header__span, styles.login__text)}>{title}</View>
      <View className={classNames(styles.header__span, styles.login__confirm, confirmClassName)} onClick={onConfirm}>{confirmText}</View>
    </View>
  )

}

ActionSheetHeader.propTypes = {
  cancelText: PropTypes.string,
  title: PropTypes.string,
  confirmText: PropTypes.string,
  onCancel: PropTypes.func,
  onConfirm: PropTypes.func,
  cancelClassName: PropTypes.string,  
  confirmClassName: PropTypes.string, 
}

export default ActionSheetHeader;